package com.ssy.lingxi.pay.entity.assetAccount;

import lombok.Data;

import javax.persistence.*;

/**
 * 账户状态记录
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/7/21
 */
@Data
@Entity
@Table(schema = "public", name = "pay_account_status_record", indexes = {@Index(name = "pay_account_status_record_account_id_idx", columnList = "memberAssetAccountId"),
        @Index(name = "pay_account_status_record_create_time_idx", columnList = "createTime")})
public class AccountStatusRecord {
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="account_status_record_seq")
    @SequenceGenerator(sequenceName="pay_account_status_record_seq", name="account_status_record_seq",allocationSize = 1)
    private Long id;

    /**
     * 会员资金账户
     */
    @OneToOne(cascade = {CascadeType.PERSIST})
    @JoinColumn(name="memberAssetAccountId",referencedColumnName = "id")
    private MemberAssetAccount memberAssetAccount;

    /**
     * 审核状态: 1-解冻, 2-冻结
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer status = 1;

    /**
     * 操作时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long createTime;

    /**
     * 操作: 1-冻结资金账户, 2-解冻资金账户
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer operation;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(200)")
    private String remark;
}
